package com.example.librarymanagementsystem.mapper;

import com.example.librarymanagementsystem.model.BookInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author : niu niu
 * @version : 1.0.0
 * @date : 2023/5/9 9:28
 */
@Mapper
public interface BookMapper {
    /**
     * 查询所有书籍
     * @return
     */
     List<BookInfo> selectAll(BookInfo bookInfo);

    /**
     * 查询所有数据条数
     * @return
     */
    @Select("select count(book_id) from books;")
     Integer countNum();

    /**
     * 增加书籍
     * @param bookInfo
     * @return
     */
     Integer insertBook(BookInfo bookInfo);

    /**
     * 修改书籍
     * @param bookInfo
     * @return
     */
    Integer updateBook(BookInfo bookInfo);

    /**
     * 下架书籍
     * @param bookInfo
     * @return
     */
    Integer deleteBook(BookInfo  bookInfo);

    /**
     * 批量删除
     *
     */
    Integer deleteBookByList(List<Integer> ids);
}
